package com.molin.mapTest;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class foriMap {
    public static void main(String[] args) {
        Map<String ,String > map=new HashMap<>();
        map.put("molin001","xiaoming");
        map.put("molin002","xiaohei");
        map.put("molin003","xiaoli");
//        forione(map);
        Set<Map.Entry<String, String>> entries = map.entrySet();
        for (Map.Entry<String, String> entry : entries) {
            System.out.println(entry.getKey()+"----------"+entry.getValue());
        }
    }

    public static void forione(Map<String, String> map) {
        Set<String> keys = map.keySet();
        for (String key : keys) {
            String value = map.get(key);
            System.out.println(key+"----------"+value);
        }
    }
}
